package com.fastwire.carriere.common.util;

import com.fastwire.carriere.controller.ControllerProxy;
import com.fastwire.carriere.user.vo.SessionVo;

public class ResourceUtil {

	public static Object getSessionBindClassByName(String className,
			SessionVo sessionVo, boolean isSessionReliable) {
		Object classObj = getClassByName(className);

		ControllerProxy handler = new ControllerProxy(sessionVo,
				isSessionReliable);
		Object bindObj = handler.bind(classObj);
		return bindObj;
	}

	public static Object getClassByName(String className) {

		try {

			Object classObj = Class.forName(className).newInstance();

			return classObj;
		} catch (Exception e) {
			CommonLogger.error(ResourceUtil.class, "get class name error: ", e);
			return null;
		}
	}

}
